package com.ldatum.crm.serviceImpl;

import java.util.List;

import com.ldatum.crm.dao.EmployeeDao;
import com.ldatum.crm.daoImpl.EmployeeDaoImpl;
import com.ldatum.crm.domain.Employee;
import com.ldatum.crm.service.EmployeeService;

public class EmployeeServiceImpl implements EmployeeService {

	EmployeeDao employeeDao = new EmployeeDaoImpl();
	@Override
	public void add(Employee employee) throws Exception {
		employeeDao.add(employee);
	}

	@Override
	public void delete(Employee employee, int id) throws Exception {
		employeeDao.delete(employee, id);
	}

	@Override
	public void update(Employee employee, int id) throws Exception {
		employeeDao.update(employee, id);
	}

	@Override
	public Employee findById(Class<Employee> clazz,int id) throws Exception {
		return employeeDao.findById(clazz,id);
	}

	@Override
	public Employee findByLoginname(Class<Employee> clazz, String loginname)
			throws Exception {
		return employeeDao.findByLoginname(clazz,loginname);
	}

	@Override
	public List<Employee> list(Class<Employee> clazz) throws Exception {
		return employeeDao.list(clazz);
	}

}
